﻿using System;
using UnityEngine;

// Token: 0x0200013C RID: 316
public class CameraAutoSwitch : MonoBehaviour
{
	// Token: 0x06000722 RID: 1826 RVA: 0x0002A8C4 File Offset: 0x00028AC4
	private void Start()
	{
		this.now = -1;
		this.Switch();
	}

	// Token: 0x06000723 RID: 1827 RVA: 0x0002A8D4 File Offset: 0x00028AD4
	private void Update()
	{
		this.timer -= Time.deltaTime;
		if (this.timer <= 0f)
		{
			this.Switch();
		}
	}

	// Token: 0x06000724 RID: 1828 RVA: 0x0002A900 File Offset: 0x00028B00
	private void Switch()
	{
		if (this.cameras.Length == 0)
		{
			return;
		}
		this.now = (this.now + 1) % this.cameras.Length;
		for (int i = 0; i < this.cameras.Length; i++)
		{
			this.cameras[i].gameObject.SetActive(this.now == i);
		}
		this.timer = this.switchWait;
	}

	// Token: 0x0400072E RID: 1838
	[SerializeField]
	private Camera[] cameras;

	// Token: 0x0400072F RID: 1839
	[SerializeField]
	private float switchWait = 3f;

	// Token: 0x04000730 RID: 1840
	private int now;

	// Token: 0x04000731 RID: 1841
	private float timer;
}
